---
title: "Educational Data Science Capstone Project"
output:
flexdashboard::flex_dashboard:
orientation: rows
social: menu
source_code: embed
vertical_layout: scroll
theme: united
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(here)
library(janitor)
library(rio)
library(colorblindr)
library(gghighlight)
library(forcats)
library(ggrepel)
library(gt)
library(knitr)
library(kableExtra)
library(reactable)
library(plotly)
library(glue)
library(fs)
library(rstatix)
library(ggpubr)
library(writexl)
library(remotes)
theme_set(theme_minimal(15) +
theme(legend.position = "bottom",
panel.grid.major.x = element_line(color = "gray60"),
panel.grid.minor.x = element_blank(),
panel.grid.major.y = element_blank())
)
```
```{r, include=FALSE}
# all impact data
impact_all <- read_csv(here("data", "impact_data.csv"))
str(impact_all)
#all clean sims data
sims_concussion_data <- read_csv(here("data", "sims_concussion_data.csv"))
str(sims_concussion_data)
#impact data only
one_impact_test <- read_csv(here("data", "one_post_injury_impact_test.csv"))
str(one_impact_test)
two_impact_test <- read_csv(here("data", "two_post_injury_impact_test.csv"))
three_impact_test <- read_csv(here("data", "three_post_injury_impact_test.csv"))
four_impact_test <- read_csv(here("data", "four_post_injury_impact_test.csv"))
# impact sims merge data
one_impact_sims <- read_csv(here("data", "one_post_injury_test_impact_sims_merge.csv"))
str(one_impact_sims)
two_impact_sims <- read_csv(here("data", "two_post_injury_test_impact_sims_merge.csv"))
three_impact_sims <- read_csv(here("data", "three_post_injury_test_impact_sims_merge.csv"))
four_impact_sims <- read_csv(here("data", "four_post_injury_test_impact_sims_merge.csv"))
# pcss items
pcss_items <- import(here("data", "pcss_items.xlsx"),
setclass = "tbl_df")
pcss_cluster <- import(here("data", "cluster_scores.xlsx"),
setclass = "tbl_df")
rtp_steps <- import(here("data", "rtp_steps.xlsx"),
setclass = "tbl_df")
rtl <- import(here("data", "rtl_description.xlsx"),
setclass = "tbl_df")
```
```{r, include=FALSE}
#helpful functions
mean_2 <- function(x) {
z <- na.omit(x)
sum(z) / length(z)
}
my_mean <- function(x) {
mean(x[x >= 0], na.rm = TRUE)
}
create_react_time <- function(df, var) {
df %>%
summarize(Mean = mean({{var}}),
SD = sd({{var}}),
Min = min({{var}}),
Max = max({{var}}),
Total = length({{var}})) %>%
mutate_if(is.numeric, round, 2) %>%
reactable(columns = list(
Mean = colDef(format = colFormat(separators = TRUE, suffix = " days")),
SD = colDef(format = colFormat(separators = TRUE, suffix = " days")),
Min = colDef(format = colFormat(separators = TRUE, suffix = " days")),
Max = colDef(format = colFormat(separators = TRUE, suffix = " days")),
Total = colDef(format = colFormat(separators = TRUE, suffix = " concussions"))
))
}
create_react <- function(df, var) {
df %>%
summarize(Mean = mean({{var}}),
SD = sd({{var}}),
Min = min({{var}}),
Max = max({{var}}),
Total = length({{var}})) %>%
mutate_if(is.numeric, round, 2) %>%
reactable(columns = list(
Mean = colDef(format = colFormat(separators = TRUE)),
SD = colDef(format = colFormat(separators = TRUE)),
Min = colDef(format = colFormat(separators = TRUE)),
Max = colDef(format = colFormat(separators = TRUE)),
Total = colDef(format = colFormat(separators = TRUE, suffix = " concussions"))
))
}
```
# Data Overview
Sidebar {.sidebar}
------------
**_Data Description:_** The data for this capstone project was provided by the Hawaii Concussion Awareness and Management Program [(HCAMP)](https://hawaiiconcussion.com/), which is an organization affiliated with the University of Hawaii. The mission of HCAMP is to develop evidence-based interventions to manage concussion.
The specific goal of this project is to explore trends from two data sets. The first data set contains multiple years of test and symptom severity scores from the Immediate Post-Concussion Assessment and Cognitive Testing [(ImPACT)](https://impactconcussion.com/) software. The second data set contains multiple years of return-to-learn (RTL) and return-to-play (RTP) outcome data from the Hawaii Department of Education Student Information Management System (SIMS). The ImPACT data set is utilized to explore trends in symptom severity, as measured by the [Post-Concussion Symptom Scale (PCSS)](tools/Post-Concussion-Symptom-Scale1.pdf), across individuals who completed post-injury testing following their concussion. The ImPACT data set is divided into four smaller data sets to represent individuals who completed one post-injury test, two post-injury tests, three post-injury tests, and four post-injury tests. Specific to this data set, the following research question is explored: Is there a significant difference between PCSS cluster symptom scores during the recovery process? The six symptom clusters used for this project are adapted from Lumba-Brown et al. (2019) and Harmon et al. (2019).
The SIMS data set is utilized to explore trends in the duration of time to complete RTL and RTP protocols. The ImPACT and SIMS data sets have been joined corresponding to the number of post-injury tests completed from the ImPACT data set. Although the merger of these data sets did not yield a large number of observations to analyze, the following research question is explored: What is the relationship between symptom severity scores and RTL/RTP duration?
The top row of the *Data Overview* tab displays information on the number of individuals who completed multiple ImPACT tests as well as information on the PCSS. The second row displays information on the complete SIMS data set, consisting of individuals who experienced a documented concussion and were tracked for recovery during the RTL and RTP process.
Row {.tabset}
-----------------------------------------------------------------------
### ImPACT Test Totals
```{r, include=FALSE}
t_sum_pi <- data.frame("Level" = c("One Post-Injury Test",
"Two Post-Injury Tests",
"Three Post-Injury Tests",
"Four Post-Injury Tests"),
"Total" = c(9991,
5295,
2228,
780))
```
```{r, include=FALSE}
t_sum_pi %>%
reactable(columns = list(
Level = colDef(name = "Level",
align = "center"),
Total = colDef(name = "Total",
align = "center",
format = colFormat(separators = TRUE, suffix = " individuals"))),
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE)
```
```{r, include=FALSE}
pi_plot <- ggplot(t_sum_pi, aes(fct_reorder(Level, Total), Total)) +
geom_col(fill = "blue",
alpha = 0.7) +
scale_y_continuous(labels = function(x) format(x, big.mark = ",",
scientific = FALSE)) +
coord_flip() +
labs(x = "",
y = "Individuals")
```
```{r, include=TRUE}
ggplotly(pi_plot)
```
### PCSS Item Description
```{r}
pcss_items %>%
reactable(columns = list(
Item = colDef(name = "Item",
align = "center"),
Symptom = colDef(name = "Symptom",
align = "center"),
Cluster = colDef(name = "Cluster",
align = "center")),
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE,
searchable = TRUE)
```
### PCSS Symptom Clusters
```{r, include=FALSE}
head(pcss_cluster)
pcss_cluster_plot <- ggplot(pcss_cluster, aes(fct_reorder(Cluster, `Total Possible Severity Score`),
`Total Possible Severity Score`)) +
geom_col(fill = "blue",
alpha = 0.7) +
scale_y_continuous(limits = c(0, 30),
breaks = c(0, 5, 10, 15, 20, 25, 30)) +
coord_flip() +
labs(x = "",
y = "Total Possible Severity Score",
caption = "Total Possible Severity Score = 132")
```
```{r, include=TRUE}
ggplotly(pcss_cluster_plot)
```
Row {.tabset}
-----------------------------------------------------------------------
### Sims - Gender
```{r, include=FALSE}
sims_concussion_data %>%
group_by(gender) %>%
summarize(total = n()) %>%
arrange(desc(total)) %>%
reactable(
columns = list(
gender = colDef(name = "Gender",
align = "center"),
total = colDef(name = "Total",
align = "center",
format = colFormat(suffix = " concussions"))),
pagination = TRUE,
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE
)
```
```{r, include=FALSE}
sims_gender <- sims_concussion_data %>%
group_by(gender) %>%
summarize(total = n()) %>%
arrange(desc(total))
sims_gender_plot <- ggplot(sims_gender, aes(fct_reorder(gender, total), total)) +
geom_col(fill = "blue",
alpha = 0.7) +
scale_y_continuous(limits = c(0, 600),
breaks = c(0, 200, 400, 600)) +
coord_flip() +
labs(x = "",
y = "Total")
```
```{r, include=TRUE}
ggplotly(sims_gender_plot)
```
### Sims - Age
```{r, include=FALSE}
sims_concussion_data %>%
group_by(age) %>%
summarize(total = n()) %>%
reactable(
columns = list(
age = colDef(name = "Age",
align = "center"),
total = colDef(name = "Total",
align = "center",
format = colFormat(suffix = " concussions"))),
pagination = TRUE,
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE
)
```
```{r, include=FALSE}
sims_age <- sims_concussion_data %>%
mutate(age = as.factor(age)) %>%
group_by(age) %>%
summarize(total = n()) %>%
arrange(desc(total))
sims_age_plot <- ggplot(sims_age, aes(fct_reorder(age, total), total)) +
geom_col(fill = "blue",
alpha = 0.7) +
coord_flip() +
labs(x = "Age",
y = "Total")
```
```{r, include=TRUE}
ggplotly(sims_age_plot)
```
### Sims - League
```{r, include=FALSE}
sims_concussion_data %>%
group_by(league) %>%
summarize(total = n()) %>%
arrange(desc(total)) %>%
reactable(
columns = list(
league = colDef(name = "League",
align = "center"),
total = colDef(name = "Total",
align = "center",
format = colFormat(suffix = " concussions"))),
pagination = TRUE,
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE
)
```
```{r, include=FALSE}
sims_league <- sims_concussion_data %>%
group_by(league) %>%
summarize(total = n()) %>%
arrange(desc(total))
sims_league_plot <- ggplot(sims_league, aes(fct_reorder(league, total), total)) +
geom_col(fill = "blue",
alpha = 0.7) +
scale_y_continuous(limits = c(0, 500),
breaks = c(0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500)) +
coord_flip() +
labs(x = "",
y = "Total")
```
```{r, include=TRUE}
ggplotly(sims_league_plot)
```
### Sims - School
```{r}
sims_concussion_data %>%
group_by(school) %>%
summarize(total = n()) %>%
arrange(desc(total)) %>%
reactable(
columns = list(
school = colDef(name = "School",
align = "center"),
total = colDef(name = "Total",
align = "center",
format = colFormat(suffix = " concussions"))),
pagination = TRUE,
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE,
searchable = TRUE
)
```
### Sims - Sport
```{r}
sims_concussion_data %>%
group_by(sport) %>%
summarize(total = n()) %>%
arrange(desc(total)) %>%
reactable(
columns = list(
sport = colDef(name = "Sport",
align = "center"),
total = colDef(name = "Total",
align = "center",
format = colFormat(suffix = " concussions"))),
pagination = TRUE,
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE,
searchable = TRUE
)
```
### Sims - Sport Level
```{r, include=FALSE}
sims_concussion_data %>%
group_by(level) %>%
summarize(total = n()) %>%
arrange(desc(total)) %>%
reactable(
columns = list(
level = colDef(name = "Level",
align = "center"),
total = colDef(name = "Total",
align = "center",
format = colFormat(suffix = " concussions"))),
pagination = TRUE,
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE
)
```
```{r, include=FALSE}
sims_level <- sims_concussion_data %>%
group_by(level) %>%
summarize(total = n()) %>%
arrange(desc(total))
sims_level_plot <- ggplot(sims_level, aes(fct_reorder(level, total), total)) +
geom_col(fill = "blue",
alpha = 0.7) +
scale_y_continuous(limits = c(0, 500),
breaks = c(0, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500)) +
coord_flip() +
labs(x = "",
y = "Total")
```
```{r, include=TRUE}
ggplotly(sims_level_plot)
```
### Sims - RTL Summary
```{r, include=TRUE}
create_react_time(sims_concussion_data, dys_btwn_onset_rtp_3)
```
### Sims - RTL Plot
```{r, include=FALSE}
rtl_smry_plot <- ggplot(sims_concussion_data, aes(dys_btwn_onset_rtp_3)) +
geom_histogram(fill = "#56B4E9",
color = "white",
alpha = 0.9,
bins = 10) +
facet_wrap(~gender, nrow = 1) +
labs(x = "Days to Complete RTL",
y = "")
```
```{r, include=TRUE}
ggplotly(rtl_smry_plot)
```
### Sims - RTP Summary
```{r, include=TRUE}
create_react_time(sims_concussion_data, dys_btwn_onset_rtp_7)
```
### Sims - RTP Plot
```{r, include=FALSE}
rtp_smry_plot <- ggplot(sims_concussion_data, aes(dys_btwn_onset_rtp_7)) +
geom_histogram(fill = "#56B4E9",
color = "white",
alpha = 0.9,
bins = 10) +
facet_wrap(~gender, nrow = 1) +
labs(x = "Days to Complete RTP",
y = "")
```
```{r, include=TRUE}
ggplotly(rtp_smry_plot)
```
# One Post-Injury Test
Sidebar {.sidebar}
------------
**_Description:_** This tab provides summaries and visualizations of PCSS severity scores for the 9,991 concussion cases where the individual completed one post-injury test during recovery.
The bottom row provides summaries and visualizations of PCSS severity scores for the 254 concussion cases representing the merged ImPACT and SIMS data sets where the individual completed one post-injury test during recovery.
Row {.tabset}
-----------------------------------------------------------------------
### Total Symptom Score Histogram
```{r, include=FALSE}
head(one_impact_test)
score_hist <- function(df, x) {
ggplot(df, aes({{x}})) +
geom_histogram(fill = "#56B4E9",
color = "white",
alpha = 0.9,
bins = 25) +
labs(x = "Symptom Severity",
y = "Number of Individuals")
}
gender_hist <- function(df, x) {
ggplot(df, aes({{x}})) +
geom_histogram(fill = "#56B4E9",
color = "white",
alpha = 0.9,
bins = 25) +
facet_wrap(~gender) +
labs(x = "Symptom Severity",
y = "")
}
```
```{r, include=TRUE}
ggplotly(score_hist(one_impact_test, total_symptom_score_post_injury_1))
```
### Total Symptom Score Summary
```{r, include=TRUE}
create_react(one_impact_test, total_symptom_score_post_injury_1)
```
### Total Symptom Score Summary - Gender
```{r, include=FALSE}
gender_symptom_tbl <- function(df, x) {
df %>%
group_by(gender) %>%
summarize(mean = mean({{x}}),
sd = sd({{x}}),
min = min({{x}}),
max = max({{x}}),
total = length({{x}})) %>%
mutate(mean = as.numeric(mean),
sd = as.numeric(sd),
min = as.numeric(min),
max = as.numeric(max),
total = as.numeric(total)) %>%
reactable(
columns = list(
gender = colDef(name = "Gender",
align = "center"),
mean = colDef(name = "Mean",
align = "center",
format = colFormat(digits = 2, separators = TRUE)),
sd = colDef(name = "SD",
align = "center",
format = colFormat(digits = 2, separators = TRUE)),
min = colDef(name = "Min",
align = "center",
format = colFormat(separators = TRUE)),
max = colDef(name = "Max",
align = "center",
format = colFormat(separators = TRUE)),
total = colDef(name = "Total",
align = "center",
format = colFormat(separators = TRUE, suffix = " concussions"))),
pagination = TRUE,
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE
)
}
gender_symptom_tbl(one_impact_test, total_symptom_score_post_injury_1)
```
```{r, include=TRUE}
gender_symptom_tbl(one_impact_test, total_symptom_score_post_injury_1)
```
### Total Symptom Score Gender Visual Comparison
```{r, include=TRUE}
ggplotly(gender_hist(one_impact_test, total_symptom_score_post_injury_1))
```
Row {.tabset}
-----------------------------------------------------------------------
### Headache-Migraine Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_test, headache_migraine_cluster_score_post_injury_1))
```
### Headache-Migraine Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_test, headache_migraine_cluster_score_post_injury_1)
```
### Headache-Migraine Cluster Score Summary - Gender
```{r, include=TRUE}
gender_symptom_tbl(one_impact_test, headache_migraine_cluster_score_post_injury_1)
```
### Headache-Migraine Score Gender Visual Comparison
```{r, include=TRUE}
ggplotly(gender_hist(one_impact_test, headache_migraine_cluster_score_post_injury_1))
```
Row {.tabset}
-----------------------------------------------------------------------
### Cognitive Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_test, cognitive_cluster_score_post_injury_1))
```
### Cognitive Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_test, cognitive_cluster_score_post_injury_1)
```
### Cognitive Cluster Score Summary - Gender
```{r, include=TRUE}
gender_symptom_tbl(one_impact_test, cognitive_cluster_score_post_injury_1)
```
### Cognitive Score Gender Visual Comparison
```{r, include=TRUE}
ggplotly(gender_hist(one_impact_test, cognitive_cluster_score_post_injury_1))
```
Row {.tabset}
-----------------------------------------------------------------------
### Anxiety-Mood Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_test, anxiety_mood_cluster_score_post_injury_1))
```
### Anxiety-Mood Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_test, anxiety_mood_cluster_score_post_injury_1)
```
### Anxiety-Mood Cluster Score Summary - Gender
```{r, include=TRUE}
gender_symptom_tbl(one_impact_test, anxiety_mood_cluster_score_post_injury_1)
```
### Anxiety-Mood Score Gender Visual Comparison
```{r, include=TRUE}
ggplotly(gender_hist(one_impact_test, anxiety_mood_cluster_score_post_injury_1))
```
Row {.tabset}
-----------------------------------------------------------------------
### Ocular-Motor Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_test, ocular_motor_cluster_score_post_injury_1))
```
### Ocular-Motor Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_test, ocular_motor_cluster_score_post_injury_1)
```
### Ocular-Motor Cluster Score Summary - Gender
```{r, include=TRUE}
gender_symptom_tbl(one_impact_test, ocular_motor_cluster_score_post_injury_1)
```
### Ocular-Motor Score Gender Visual Comparison
```{r, include=TRUE}
ggplotly(gender_hist(one_impact_test, ocular_motor_cluster_score_post_injury_1))
```
Row {.tabset}
-----------------------------------------------------------------------
### Vestibular Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_test, vestibular_cluster_score_post_injury_1))
```
### Vestibular Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_test, vestibular_cluster_score_post_injury_1)
```
### Vestibular Cluster Score Summary - Gender
```{r, include=TRUE}
gender_symptom_tbl(one_impact_test, vestibular_cluster_score_post_injury_1)
```
### Vestibular Score Gender Visual Comparison
```{r, include=TRUE}
ggplotly(gender_hist(one_impact_test, vestibular_cluster_score_post_injury_1))
```
Row {.tabset}
-----------------------------------------------------------------------
### Sleep Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_test, sleep_cluster_score_post_injury_1))
```
### Sleep Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_test, sleep_cluster_score_post_injury_1)
```
### Sleep Cluster Score Summary - Gender
```{r, include=TRUE}
gender_symptom_tbl(one_impact_test, sleep_cluster_score_post_injury_1)
```
### Sleep Score Gender Visual Comparison
```{r, include=TRUE}
ggplotly(gender_hist(one_impact_test, sleep_cluster_score_post_injury_1))
```
Row {.tabset}
-----------------------------------------------------------------------
### Merged Total Symptom Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_sims, total_symptom_score_post_injury_1))
```
### Merged Total Symptom Score Summary
```{r, include=TRUE}
create_react(one_impact_sims, total_symptom_score_post_injury_1)
```
### Merged Headache-Migraine Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_sims, headache_migraine_cluster_score_post_injury_1))
```
### Merged Headache-Migraine Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_sims, headache_migraine_cluster_score_post_injury_1)
```
### Merged Cognitive Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_sims, cognitive_cluster_score_post_injury_1))
```
### Merged Cognitive Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_sims, cognitive_cluster_score_post_injury_1)
```
### Merged Anxiety-Mood Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_sims, anxiety_mood_cluster_score_post_injury_1))
```
### Merged Anxiety-Mood Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_sims, anxiety_mood_cluster_score_post_injury_1)
```
### Merged Ocular-Motor Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_sims, ocular_motor_cluster_score_post_injury_1))
```
### Merged Ocular-Motor Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_sims, ocular_motor_cluster_score_post_injury_1)
```
### Merged Vestibular Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_sims, vestibular_cluster_score_post_injury_1))
```
### Merged Vestibular Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_sims, vestibular_cluster_score_post_injury_1)
```
### Merged Sleep Cluster Score Histogram
```{r, include=TRUE}
ggplotly(score_hist(one_impact_sims, sleep_cluster_score_post_injury_1))
```
### Merged Sleep Cluster Score Summary
```{r, include=TRUE}
create_react(one_impact_sims, sleep_cluster_score_post_injury_1)
```
# Two Post-Injury Tests
Sidebar {.sidebar}
------------
**_Description:_** This tab provides summaries and visualizations of PCSS severity scores for the 5,295 concussion cases where the individual completed two post-injury tests during recovery.
Across all symptom clusters and the total symptom score, post-injury 1 symptom severity was significantly higher than post-injury 2 symptom severity.
The bottom row provides summaries and visualizations of PCSS severity scores for the 336 concussion cases representing the merged ImPACT and SIMS data sets where the individual completed two post-injury tests during recovery.
Row {.tabset}
-----------------------------------------------------------------------
### Total Symptom Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, total_symptom_score_post_injury_1))
```
### Total Symptom Score Test 1 Summary
```{r, include=TRUE}
create_react(two_impact_test, total_symptom_score_post_injury_1)
```
### Total Symptom Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, total_symptom_score_post_injury_2))
```
### Total Symptom Score Test 2 Summary
```{r, include=TRUE}
create_react(two_impact_test, total_symptom_score_post_injury_2)
```
### Boxplot Comparison
```{r, include=FALSE}
bxp_t_test <- function(df, x, y) {
ggplot(df, aes({{x}}, {{y}}, color = {{y}})) +
geom_boxplot() +
geom_jitter(position = position_jitter(0.15)) +
labs(x = "",
y = "Symptom Severity") +
theme(legend.position = "none") +
stat_compare_means(method = "t.test", paired = TRUE, hjust = -0.3)
}
two_impact_total_symptom_score <- two_impact_test %>%
select(2, 3, 4, 5, 57, 58) %>%
pivot_longer(
cols = c(5:6),
names_to = "test",
names_prefix = "total_symptom_score_",
values_to = "score"
)
bxp_t_test(two_impact_total_symptom_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_t_test(two_impact_total_symptom_score, test, score))
```
### *T*-Test Results
```{r, include=FALSE}
two_impact_test_total_symptom_score_1 <- two_impact_test$total_symptom_score_post_injury_1
two_impact_test_total_symptom_score_2 <- two_impact_test$total_symptom_score_post_injury_2
two_impact_test_total_symptom_score_res <- t.test(two_impact_test_total_symptom_score_1,
two_impact_test_total_symptom_score_2,
paired = TRUE)
two_impact_test_total_symptom_score_res
```
```{r, include=TRUE}
two_impact_test_total_symptom_score_res
```
Row {.tabset}
-----------------------------------------------------------------------
### Headache-Migraine Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, headache_migraine_cluster_score_post_injury_1))
```
### Headache-Migraine Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(two_impact_test, headache_migraine_cluster_score_post_injury_1)
```
### Headache-Migraine Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, headache_migraine_cluster_score_post_injury_2))
```
### Headache-Migraine Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(two_impact_test, headache_migraine_cluster_score_post_injury_2)
```
### Boxplot Comparison
```{r, include=FALSE}
two_impact_headache_migraine_cluster_score <- two_impact_test %>%
select(2, 3, 4, 5, 59, 60) %>%
pivot_longer(
cols = c(5:6),
names_to = "test",
names_prefix = "headache_migraine_cluster_score_",
values_to = "score"
)
bxp_t_test(two_impact_headache_migraine_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_t_test(two_impact_headache_migraine_cluster_score, test, score))
```
### *T*-Test Results
```{r, include=FALSE}
two_impact_test_headache_migraine_cluster_score_1 <- two_impact_test$headache_migraine_cluster_score_post_injury_1
two_impact_test_headache_migraine_cluster_score_2 <- two_impact_test$headache_migraine_cluster_score_post_injury_2
two_impact_test_headache_migraine_cluster_score_res <- t.test(two_impact_test_headache_migraine_cluster_score_1,
two_impact_test_headache_migraine_cluster_score_2,
paired = TRUE)
two_impact_test_headache_migraine_cluster_score_res
```
```{r, include=TRUE}
two_impact_test_headache_migraine_cluster_score_res
```
Row {.tabset}
-----------------------------------------------------------------------
### Cognitive Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, cognitive_cluster_score_post_injury_1))
```
### Cognitive Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(two_impact_test, cognitive_cluster_score_post_injury_1)
```
### Cognitive Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, cognitive_cluster_score_post_injury_2))
```
### Cognitive Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(two_impact_test, cognitive_cluster_score_post_injury_2)
```
### Boxplot Comparison
```{r, include=FALSE}
two_impact_cognitive_cluster_score <- two_impact_test %>%
select(2, 3, 4, 5, 61, 62) %>%
pivot_longer(
cols = c(5:6),
names_to = "test",
names_prefix = "cognitive_cluster_score_",
values_to = "score"
)
bxp_t_test(two_impact_cognitive_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_t_test(two_impact_cognitive_cluster_score, test, score))
```
### *T*-Test Results
```{r, include=FALSE}
two_impact_test_cognitive_cluster_score_1 <- two_impact_test$cognitive_cluster_score_post_injury_1
two_impact_test_cognitive_cluster_score_2 <- two_impact_test$cognitive_cluster_score_post_injury_2
two_impact_test_cognitive_cluster_score_res <- t.test(two_impact_test_cognitive_cluster_score_1,
two_impact_test_cognitive_cluster_score_2,
paired = TRUE)
two_impact_test_cognitive_cluster_score_res
```
```{r, include=TRUE}
two_impact_test_cognitive_cluster_score_res
```
Row {.tabset}
-----------------------------------------------------------------------
### Anxiety-Mood Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, anxiety_mood_cluster_score_post_injury_1))
```
### Anxiety-Mood Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(two_impact_test, anxiety_mood_cluster_score_post_injury_1)
```
### Anxiety-Mood Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, anxiety_mood_cluster_score_post_injury_2))
```
### Anxiety-Mood Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(two_impact_test, anxiety_mood_cluster_score_post_injury_2)
```
### Boxplot Comparison
```{r, include=FALSE}
two_impact_anxiety_mood_cluster_score <- two_impact_test %>%
select(2, 3, 4, 5, 63, 64) %>%
pivot_longer(
cols = c(5:6),
names_to = "test",
names_prefix = "anxiety_mood_cluster_score_",
values_to = "score"
)
bxp_t_test(two_impact_anxiety_mood_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_t_test(two_impact_anxiety_mood_cluster_score, test, score))
```
### *T*-Test Results
```{r, include=FALSE}
two_impact_test_anxiety_mood_cluster_score_1 <- two_impact_test$anxiety_mood_cluster_score_post_injury_1
two_impact_test_anxiety_mood_cluster_score_2 <- two_impact_test$anxiety_mood_cluster_score_post_injury_2
two_impact_test_anxiety_mood_cluster_score_res <- t.test(two_impact_test_anxiety_mood_cluster_score_1,
two_impact_test_anxiety_mood_cluster_score_2,
paired = TRUE)
two_impact_test_anxiety_mood_cluster_score_res
```
```{r, include=TRUE}
two_impact_test_anxiety_mood_cluster_score_res
```
Row {.tabset}
-----------------------------------------------------------------------
### Ocular-Motor Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, ocular_motor_cluster_score_post_injury_1))
```
### Ocular-Motor Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(two_impact_test, ocular_motor_cluster_score_post_injury_1)
```
### Ocular-Motor Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, ocular_motor_cluster_score_post_injury_2))
```
### Ocular-Motor Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(two_impact_test, ocular_motor_cluster_score_post_injury_2)
```
### Boxplot Comparison
```{r, include=FALSE}
two_impact_ocular_motor_cluster_score <- two_impact_test %>%
select(2, 3, 4, 5, 65, 66) %>%
pivot_longer(
cols = c(5:6),
names_to = "test",
names_prefix = "ocular_motor_cluster_score_",
values_to = "score"
)
bxp_t_test(two_impact_ocular_motor_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_t_test(two_impact_ocular_motor_cluster_score, test, score))
```
### *T*-Test Results
```{r, include=FALSE}
two_impact_test_ocular_motor_cluster_score_1 <- two_impact_test$ocular_motor_cluster_score_post_injury_1
two_impact_test_ocular_motor_cluster_score_2 <- two_impact_test$ocular_motor_cluster_score_post_injury_2
two_impact_test_ocular_motor_cluster_score_res <- t.test(two_impact_test_ocular_motor_cluster_score_1,
two_impact_test_ocular_motor_cluster_score_2,
paired = TRUE)
two_impact_test_ocular_motor_cluster_score_res
```
```{r, include=TRUE}
two_impact_test_ocular_motor_cluster_score_res
```
Row {.tabset}
-----------------------------------------------------------------------
### Vestibular Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, vestibular_cluster_score_post_injury_1))
```
### Vestibular Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(two_impact_test, vestibular_cluster_score_post_injury_1)
```
### Vestibular Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, vestibular_cluster_score_post_injury_2))
```
### Vestibular Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(two_impact_test, vestibular_cluster_score_post_injury_2)
```
### Boxplot Comparison
```{r, include=FALSE}
two_impact_vestibular_cluster_score <- two_impact_test %>%
select(2, 3, 4, 5, 67, 68) %>%
pivot_longer(
cols = c(5:6),
names_to = "test",
names_prefix = "vestibular_cluster_score_",
values_to = "score"
)
bxp_t_test(two_impact_vestibular_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_t_test(two_impact_vestibular_cluster_score, test, score))
```
### *T*-Test Results
```{r, include=FALSE}
two_impact_test_vestibular_cluster_score_1 <- two_impact_test$vestibular_cluster_score_post_injury_1
two_impact_test_vestibular_cluster_score_2 <- two_impact_test$vestibular_cluster_score_post_injury_2
two_impact_test_vestibular_cluster_score_res <- t.test(two_impact_test_vestibular_cluster_score_1,
two_impact_test_vestibular_cluster_score_2,
paired = TRUE)
two_impact_test_vestibular_cluster_score_res
```
```{r, include=TRUE}
two_impact_test_vestibular_cluster_score_res
```
Row {.tabset}
-----------------------------------------------------------------------
### Sleep Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, sleep_cluster_score_post_injury_1))
```
### Sleep Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(two_impact_test, sleep_cluster_score_post_injury_1)
```
### Sleep Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(two_impact_test, sleep_cluster_score_post_injury_2))
```
### Sleep Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(two_impact_test, sleep_cluster_score_post_injury_2)
```
### Boxplot Comparison
```{r, include=FALSE}
two_impact_sleep_cluster_score <- two_impact_test %>%
select(2, 3, 4, 5, 69, 70) %>%
pivot_longer(
cols = c(5:6),
names_to = "test",
names_prefix = "sleep_cluster_score_",
values_to = "score"
)
bxp_t_test(two_impact_sleep_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_t_test(two_impact_sleep_cluster_score, test, score))
```
### *T*-Test Results
```{r, include=FALSE}
two_impact_test_sleep_cluster_score_1 <- two_impact_test$sleep_cluster_score_post_injury_1
two_impact_test_sleep_cluster_score_2 <- two_impact_test$sleep_cluster_score_post_injury_2
two_impact_test_sleep_cluster_score_res <- t.test(two_impact_test_sleep_cluster_score_1,
two_impact_test_sleep_cluster_score_2,
paired = TRUE)
two_impact_test_sleep_cluster_score_res
```
```{r, include=TRUE}
two_impact_test_sleep_cluster_score_res
```
Row {.tabset}
-----------------------------------------------------------------------
### Merged Total Symptom Score Summary Test 1
```{r, include=TRUE}
create_react(two_impact_sims, total_symptom_score_post_injury_1)
```
### Merged Total Symptom Score Summary Test 2
```{r, include=TRUE}
create_react(two_impact_sims, total_symptom_score_post_injury_2)
```
### Merged Headache-Migraine Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(two_impact_sims, headache_migraine_cluster_score_post_injury_1)
```
### Merged Headache-Migraine Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(two_impact_sims, headache_migraine_cluster_score_post_injury_2)
```
### Merged Cognitive Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(two_impact_sims, cognitive_cluster_score_post_injury_1)
```
### Merged Cognitive Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(two_impact_sims, cognitive_cluster_score_post_injury_2)
```
### Merged Anxiety-Mood Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(two_impact_sims, anxiety_mood_cluster_score_post_injury_1)
```
### Merged Anxiety-Mood Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(two_impact_sims, anxiety_mood_cluster_score_post_injury_2)
```
### Merged Ocular-Motor Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(two_impact_sims, ocular_motor_cluster_score_post_injury_1)
```
### Merged Ocular-Motor Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(two_impact_sims, ocular_motor_cluster_score_post_injury_2)
```
### Merged Vestibular Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(two_impact_sims, vestibular_cluster_score_post_injury_1)
```
### Merged Vestibular Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(two_impact_sims, vestibular_cluster_score_post_injury_2)
```
### Merged Sleep Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(two_impact_sims, sleep_cluster_score_post_injury_1)
```
### Merged Sleep Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(two_impact_sims, sleep_cluster_score_post_injury_2)
```
# Three Post-Injury Tests
Sidebar {.sidebar}
------------
**_Description:_** This tab provides summaries and visualizations of PCSS severity scores for the 2,228 concussion cases where the individual completed three post-injury tests during recovery.
Across all symptom clusters and the total symptom score, post-injury 1 symptom severity was significantly higher than post-injury 2 and post-injury 3 symptom severity. Additionally, differences in symptom cluster and total symptom severity scores were significantly different between post-injury 2 and post-injury 3.
The bottom row provides summaries and visualizations of PCSS severity scores for the 133 concussion cases representing the merged ImPACT and SIMS data sets where the individual completed three post-injury tests during recovery.
Row {.tabset}
-----------------------------------------------------------------------
### Total Symptom Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, total_symptom_score_post_injury_1))
```
### Total Symptom Score Test 1 Summary
```{r, include=TRUE}
create_react(three_impact_test, total_symptom_score_post_injury_1)
```
### Total Symptom Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, total_symptom_score_post_injury_2))
```
### Total Symptom Score Test 2 Summary
```{r, include=TRUE}
create_react(three_impact_test, total_symptom_score_post_injury_2)
```
### Total Symptom Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, total_symptom_score_post_injury_3))
```
### Total Symptom Score Test 3 Summary
```{r, include=TRUE}
create_react(three_impact_test, total_symptom_score_post_injury_3)
```
### Boxplot Comparison
```{r, include=FALSE}
bxp_anova <- function(df, x, y) {
ggplot(df, aes({{x}}, {{y}}, color = {{y}})) +
geom_boxplot() +
geom_jitter(position = position_jitter(0.15)) +
labs(x = "",
y = "Symptom Severity") +
theme(legend.position = "none")
}
three_impact_total_symptom_score <- three_impact_test %>%
select(2, 3, 4, 5, 6, 83, 84, 85) %>%
pivot_longer(
cols = c(6:8),
names_to = "test",
names_prefix = "total_symptom_score_",
values_to = "score"
)
bxp_anova(three_impact_total_symptom_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_anova(three_impact_total_symptom_score, test, score))
```
### Outliers
```{r, include=FALSE}
three_impact_total_symptom_score_outliers <- three_impact_total_symptom_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 7, 8, 9)
outlier_tbl <- function(df) {
df %>%
reactable(
columns = list(
test = colDef(name = "Test",
align = "center"),
passport_id = colDef(name = "Passport ID",
align = "center"),
score = colDef(name = "Score",
align = "center"),
is.outlier = colDef(name = "Outlier Status",
align = "center"),
is.extreme = colDef(name = "Extreme Outlier Status",
align = "center")),
pagination = TRUE,
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE,
searchable = TRUE
)
}
outlier_tbl(three_impact_total_symptom_score_outliers)
```
```{r, include=TRUE}
outlier_tbl(three_impact_total_symptom_score_outliers)
```
### ANOVA
```{r, include=FALSE}
three_impact_total_symptom_score_res <- anova_test(three_impact_total_symptom_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(three_impact_total_symptom_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
three_impact_total_symptom_score_pwc <- three_impact_total_symptom_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
three_impact_total_symptom_score_pwc <- three_impact_total_symptom_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
three_impact_total_symptom_score_pwc %>%
reactable()
```
```{r, include=FALSE}
three_impact_total_symptom_score_pwc <- three_impact_total_symptom_score_pwc %>%
add_xy_position(x = "test")
ggplot(three_impact_total_symptom_score, aes(test, score, color = score)) +
geom_boxplot() +
geom_jitter(position = position_jitter(0.15)) +
stat_pvalue_manual(three_impact_total_symptom_score_pwc) +
labs(x = "",
y = "Symptom Severity",
subtitle = get_test_label(three_impact_total_symptom_score_res, detailed = TRUE),
caption = get_pwc_label(three_impact_total_symptom_score_pwc)) +
theme(legend.position = "none")
```
Row {.tabset}
-----------------------------------------------------------------------
### Headache-Migraine Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, headache_migraine_cluster_score_post_injury_1))
```
### Headache-Migraine Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(three_impact_test, headache_migraine_cluster_score_post_injury_1)
```
### Headache-Migraine Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, headache_migraine_cluster_score_post_injury_2))
```
### Headache-Migraine Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(three_impact_test, headache_migraine_cluster_score_post_injury_2)
```
### Headache-Migraine Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, headache_migraine_cluster_score_post_injury_3))
```
### Headache-Migraine Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(three_impact_test, headache_migraine_cluster_score_post_injury_3)
```
### Boxplot Comparison
```{r, include=FALSE}
three_impact_headache_migraine_cluster_score <- three_impact_test %>%
select(2, 3, 4, 5, 6, 86, 87, 88) %>%
pivot_longer(
cols = c(6:8),
names_to = "test",
names_prefix = "headache_migraine_cluster_score_",
values_to = "score"
)
```
```{r, include=TRUE}
ggplotly(bxp_anova(three_impact_headache_migraine_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
three_impact_headache_migraine_cluster_score_outliers <- three_impact_headache_migraine_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 7, 8, 9)
```
```{r, include=TRUE}
outlier_tbl(three_impact_headache_migraine_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
three_impact_headache_migraine_cluster_score_res <- anova_test(three_impact_headache_migraine_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(three_impact_headache_migraine_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
three_impact_headache_migraine_cluster_score_pwc <- three_impact_headache_migraine_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
three_impact_headache_migraine_cluster_score_pwc <- three_impact_headache_migraine_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
three_impact_headache_migraine_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Cognitive Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, cognitive_cluster_score_post_injury_1))
```
### Cognitive Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(three_impact_test, cognitive_cluster_score_post_injury_1)
```
### Cognitive Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, cognitive_cluster_score_post_injury_2))
```
### Cognitive Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(three_impact_test, cognitive_cluster_score_post_injury_2)
```
### Cognitive Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, cognitive_cluster_score_post_injury_3))
```
### Cognitive Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(three_impact_test, cognitive_cluster_score_post_injury_3)
```
### Boxplot Comparison
```{r, include=FALSE}
three_impact_cognitive_cluster_score <- three_impact_test %>%
select(2, 3, 4, 5, 6, 89, 90, 91) %>%
pivot_longer(
cols = c(6:8),
names_to = "test",
names_prefix = "cognitive_cluster_score_",
values_to = "score"
)
```
```{r, include=TRUE}
ggplotly(bxp_anova(three_impact_cognitive_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
three_impact_cognitive_cluster_score_outliers <- three_impact_cognitive_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 7, 8, 9)
```
```{r, include=TRUE}
outlier_tbl(three_impact_cognitive_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
three_impact_cognitive_cluster_score_res <- anova_test(three_impact_cognitive_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(three_impact_cognitive_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
three_impact_cognitive_cluster_score_pwc <- three_impact_cognitive_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
three_impact_cognitive_cluster_score_pwc <- three_impact_cognitive_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
three_impact_cognitive_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Anxiety-Mood Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, anxiety_mood_cluster_score_post_injury_1))
```
### Anxiety-Mood Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(three_impact_test, anxiety_mood_cluster_score_post_injury_1)
```
### Anxiety-Mood Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, anxiety_mood_cluster_score_post_injury_2))
```
### Anxiety-Mood Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(three_impact_test, anxiety_mood_cluster_score_post_injury_2)
```
### Anxiety-Mood Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, anxiety_mood_cluster_score_post_injury_3))
```
### Anxiety-Mood Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(three_impact_test, anxiety_mood_cluster_score_post_injury_3)
```
### Boxplot Comparison
```{r, include=FALSE}
three_impact_anxiety_mood_cluster_score <- three_impact_test %>%
select(2, 3, 4, 5, 6, 92, 93, 94) %>%
pivot_longer(
cols = c(6:8),
names_to = "test",
names_prefix = "anxiety_mood_cluster_score_",
values_to = "score"
)
```
```{r, include=TRUE}
ggplotly(bxp_anova(three_impact_anxiety_mood_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
three_impact_anxiety_mood_cluster_score_outliers <- three_impact_anxiety_mood_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 7, 8, 9)
```
```{r, include=TRUE}
outlier_tbl(three_impact_anxiety_mood_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
three_impact_anxiety_mood_cluster_score_res <- anova_test(three_impact_anxiety_mood_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(three_impact_anxiety_mood_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
three_impact_anxiety_mood_cluster_score_pwc <- three_impact_anxiety_mood_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
three_impact_anxiety_mood_cluster_score_pwc <- three_impact_anxiety_mood_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
three_impact_anxiety_mood_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Ocular-Motor Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, ocular_motor_cluster_score_post_injury_1))
```
### Ocular-Motor Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(three_impact_test, ocular_motor_cluster_score_post_injury_1)
```
### Ocular-Motor Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, ocular_motor_cluster_score_post_injury_2))
```
### Ocular-Motor Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(three_impact_test, ocular_motor_cluster_score_post_injury_2)
```
### Ocular-Motor Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, ocular_motor_cluster_score_post_injury_3))
```
### Ocular-Motor Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(three_impact_test, ocular_motor_cluster_score_post_injury_3)
```
### Boxplot Comparison
```{r, include=FALSE}
three_impact_ocular_motor_cluster_score <- three_impact_test %>%
select(2, 3, 4, 5, 6, 95, 96, 97) %>%
pivot_longer(
cols = c(6:8),
names_to = "test",
names_prefix = "ocular_motor_cluster_score_",
values_to = "score"
)
```
```{r, include=TRUE}
ggplotly(bxp_anova(three_impact_ocular_motor_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
three_impact_ocular_motor_cluster_score_outliers <- three_impact_ocular_motor_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 7, 8, 9)
```
```{r, include=TRUE}
outlier_tbl(three_impact_ocular_motor_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
three_impact_ocular_motor_cluster_score_res <- anova_test(three_impact_ocular_motor_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(three_impact_ocular_motor_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
three_impact_ocular_motor_cluster_score_pwc <- three_impact_ocular_motor_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
three_impact_ocular_motor_cluster_score_pwc <- three_impact_ocular_motor_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
three_impact_ocular_motor_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Vestibular Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, vestibular_cluster_score_post_injury_1))
```
### Vestibular Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(three_impact_test, vestibular_cluster_score_post_injury_1)
```
### Vestibular Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, vestibular_cluster_score_post_injury_2))
```
### Vestibular Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(three_impact_test, vestibular_cluster_score_post_injury_2)
```
### Vestibular Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, vestibular_cluster_score_post_injury_3))
```
### Vestibular Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(three_impact_test, vestibular_cluster_score_post_injury_3)
```
### Boxplot Comparison
```{r, include=FALSE}
three_impact_vestibular_cluster_score <- three_impact_test %>%
select(2, 3, 4, 5, 6, 98, 99, 100) %>%
pivot_longer(
cols = c(6:8),
names_to = "test",
names_prefix = "vestibular_cluster_score_",
values_to = "score"
)
```
```{r, include=TRUE}
ggplotly(bxp_anova(three_impact_vestibular_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
three_impact_vestibular_cluster_score_outliers <- three_impact_vestibular_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 7, 8, 9)
```
```{r, include=TRUE}
outlier_tbl(three_impact_vestibular_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
three_impact_vestibular_cluster_score_res <- anova_test(three_impact_vestibular_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(three_impact_vestibular_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
three_impact_vestibular_cluster_score_pwc <- three_impact_vestibular_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
three_impact_vestibular_cluster_score_pwc <- three_impact_vestibular_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
three_impact_vestibular_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Sleep Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, sleep_cluster_score_post_injury_1))
```
### Sleep Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(three_impact_test, sleep_cluster_score_post_injury_1)
```
### Sleep Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, sleep_cluster_score_post_injury_2))
```
### Sleep Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(three_impact_test, sleep_cluster_score_post_injury_2)
```
### Sleep Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(three_impact_test, sleep_cluster_score_post_injury_3))
```
### Sleep Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(three_impact_test, sleep_cluster_score_post_injury_3)
```
### Boxplot Comparison
```{r, include=FALSE}
three_impact_sleep_cluster_score <- three_impact_test %>%
select(2, 3, 4, 5, 6, 101, 102, 103) %>%
pivot_longer(
cols = c(6:8),
names_to = "test",
names_prefix = "sleep_cluster_score_",
values_to = "score"
)
```
```{r, include=TRUE}
ggplotly(bxp_anova(three_impact_sleep_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
three_impact_sleep_cluster_score_outliers <- three_impact_sleep_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 7, 8, 9)
```
```{r, include=TRUE}
outlier_tbl(three_impact_sleep_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
three_impact_sleep_cluster_score_res <- anova_test(three_impact_sleep_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(three_impact_sleep_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
three_impact_sleep_cluster_score_pwc <- three_impact_sleep_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
three_impact_sleep_cluster_score_pwc <- three_impact_sleep_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
three_impact_sleep_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Merged Total Symptom Score Summary Test 1
```{r, include=TRUE}
create_react(three_impact_sims, total_symptom_score_post_injury_1)
```
### Merged Total Symptom Score Summary Test 2
```{r, include=TRUE}
create_react(three_impact_sims, total_symptom_score_post_injury_2)
```
### Merged Total Symptom Score Summary Test 3
```{r, include=TRUE}
create_react(three_impact_sims, total_symptom_score_post_injury_3)
```
### Merged Headache-Migraine Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(three_impact_sims, headache_migraine_cluster_score_post_injury_1)
```
### Merged Headache-Migraine Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(three_impact_sims, headache_migraine_cluster_score_post_injury_2)
```
### Merged Headache-Migraine Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(three_impact_sims, headache_migraine_cluster_score_post_injury_3)
```
### Merged Cognitive Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(three_impact_sims, cognitive_cluster_score_post_injury_1)
```
### Merged Cognitive Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(three_impact_sims, cognitive_cluster_score_post_injury_2)
```
### Merged Cognitive Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(three_impact_sims, cognitive_cluster_score_post_injury_3)
```
### Merged Anxiety-Mood Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(three_impact_sims, anxiety_mood_cluster_score_post_injury_1)
```
### Merged Anxiety-Mood Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(three_impact_sims, anxiety_mood_cluster_score_post_injury_2)
```
### Merged Anxiety-Mood Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(three_impact_sims, anxiety_mood_cluster_score_post_injury_3)
```
### Merged Ocular-Motor Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(three_impact_sims, ocular_motor_cluster_score_post_injury_1)
```
### Merged Ocular-Motor Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(three_impact_sims, ocular_motor_cluster_score_post_injury_2)
```
### Merged Ocular-Motor Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(three_impact_sims, ocular_motor_cluster_score_post_injury_3)
```
### Merged Vestibular Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(three_impact_sims, vestibular_cluster_score_post_injury_1)
```
### Merged Vestibular Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(three_impact_sims, vestibular_cluster_score_post_injury_2)
```
### Merged Vestibular Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(three_impact_sims, vestibular_cluster_score_post_injury_3)
```
### Merged Sleep Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(three_impact_sims, sleep_cluster_score_post_injury_1)
```
### Merged Sleep Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(three_impact_sims, sleep_cluster_score_post_injury_2)
```
### Merged Sleep Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(three_impact_sims, sleep_cluster_score_post_injury_3)
```
# Four Post-Injury Tests
Sidebar {.sidebar}
------------
**_Description:_** This tab provides summaries and visualizations of PCSS severity scores for the 780 concussion cases where the individual completed three post-injury tests during recovery.
Across all symptom clusters and the total symptom score, post-injury 1 symptom severity was significantly higher than post-injury 2, post-injury 3, and post-injury 4 symptom severity. Additionally, differences in symptom cluster and total symptom severity scores were significantly different between post-injury 2, post-injury 3, and post-injury 4 with the exception of one pairwise comparison (ocular-motor symptom cluster severity between post-injury 3 and post-injury 4).
The bottom row provides summaries and visualizations of PCSS severity scores for the 32 concussion cases representing the merged ImPACT and SIMS data sets where the individual completed three post-injury tests during recovery.
Row {.tabset}
-----------------------------------------------------------------------
### Total Symptom Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, total_symptom_score_post_injury_1))
```
### Total Symptom Score Test 1 Summary
```{r, include=TRUE}
create_react(four_impact_test, total_symptom_score_post_injury_1)
```
### Total Symptom Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, total_symptom_score_post_injury_2))
```
### Total Symptom Score Test 2 Summary
```{r, include=TRUE}
create_react(four_impact_test, total_symptom_score_post_injury_2)
```
### Total Symptom Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, total_symptom_score_post_injury_3))
```
### Total Symptom Score Test 3 Summary
```{r, include=TRUE}
create_react(four_impact_test, total_symptom_score_post_injury_3)
```
### Total Symptom Score Test 4
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, total_symptom_score_post_injury_4))
```
### Total Symptom Score Test 4 Summary
```{r, include=TRUE}
create_react(four_impact_test, total_symptom_score_post_injury_4)
```
### Boxplot Comparison
```{r, include=FALSE}
four_impact_total_symptom_score <- four_impact_test %>%
select(2, 3, 4, 5, 6, 7, 109, 110, 111, 112) %>%
pivot_longer(
cols = c(7:10),
names_to = "test",
names_prefix = "total_symptom_score_",
values_to = "score"
)
bxp_anova(four_impact_total_symptom_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_anova(four_impact_total_symptom_score, test, score))
```
### Outliers
```{r, include=FALSE}
four_impact_total_symptom_score_outliers <- four_impact_total_symptom_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 8, 9, 10)
```
```{r, include=TRUE}
outlier_tbl(four_impact_total_symptom_score_outliers)
```
### ANOVA
```{r, include=FALSE}
four_impact_total_symptom_score_res <- anova_test(four_impact_total_symptom_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(four_impact_total_symptom_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
four_impact_total_symptom_score_pwc <- four_impact_total_symptom_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
four_impact_total_symptom_score_pwc <- four_impact_total_symptom_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
four_impact_total_symptom_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Headache-Migraine Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, headache_migraine_cluster_score_post_injury_1))
```
### Headache-Migraine Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(four_impact_test, headache_migraine_cluster_score_post_injury_1)
```
### Headache-Migraine Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, headache_migraine_cluster_score_post_injury_2))
```
### Headache-Migraine Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(four_impact_test, headache_migraine_cluster_score_post_injury_2)
```
### Headache-Migraine Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, headache_migraine_cluster_score_post_injury_3))
```
### Headache-Migraine Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(four_impact_test, headache_migraine_cluster_score_post_injury_3)
```
### Headache-Migraine Cluster Score Test 4
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, headache_migraine_cluster_score_post_injury_4))
```
### Headache-Migraine Cluster Score Test 4 Summary
```{r, include=TRUE}
create_react(four_impact_test, headache_migraine_cluster_score_post_injury_4)
```
### Boxplot Comparison
```{r, include=FALSE}
four_impact_headache_migraine_cluster_score <- four_impact_test %>%
select(2, 3, 4, 5, 6, 7, 113, 114, 115, 116) %>%
pivot_longer(
cols = c(7:10),
names_to = "test",
names_prefix = "headache_migraine_cluster_score_",
values_to = "score"
)
bxp_anova(four_impact_headache_migraine_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_anova(four_impact_headache_migraine_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
four_impact_headache_migraine_cluster_score_outliers <- four_impact_headache_migraine_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 8, 9, 10)
```
```{r, include=TRUE}
outlier_tbl(four_impact_headache_migraine_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
four_impact_headache_migraine_cluster_score_res <- anova_test(four_impact_headache_migraine_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(four_impact_headache_migraine_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
four_impact_headache_migraine_cluster_score_pwc <- four_impact_headache_migraine_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
four_impact_headache_migraine_cluster_score_pwc <- four_impact_headache_migraine_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
four_impact_headache_migraine_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Cognitive Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, cognitive_cluster_score_post_injury_1))
```
### Cognitive Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(four_impact_test, cognitive_cluster_score_post_injury_1)
```
### Cognitive Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, cognitive_cluster_score_post_injury_2))
```
### Cognitive Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(four_impact_test, cognitive_cluster_score_post_injury_2)
```
### Cognitive Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, cognitive_cluster_score_post_injury_3))
```
### Cognitive Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(four_impact_test, cognitive_cluster_score_post_injury_3)
```
### Cognitive Cluster Score Test 4
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, cognitive_cluster_score_post_injury_4))
```
### Cognitive Cluster Score Test 4 Summary
```{r, include=TRUE}
create_react(four_impact_test, cognitive_cluster_score_post_injury_4)
```
### Boxplot Comparison
```{r, include=FALSE}
four_impact_cognitive_cluster_score <- four_impact_test %>%
select(2, 3, 4, 5, 6, 7, 117, 118, 119, 120) %>%
pivot_longer(
cols = c(7:10),
names_to = "test",
names_prefix = "cognitive_cluster_score_",
values_to = "score"
)
bxp_anova(four_impact_cognitive_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_anova(four_impact_cognitive_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
four_impact_cognitive_cluster_score_outliers <- four_impact_cognitive_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 8, 9, 10)
```
```{r, include=TRUE}
outlier_tbl(four_impact_cognitive_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
four_impact_cognitive_cluster_score_res <- anova_test(four_impact_cognitive_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(four_impact_cognitive_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
four_impact_cognitive_cluster_score_pwc <- four_impact_cognitive_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
four_impact_cognitive_cluster_score_pwc <- four_impact_cognitive_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
four_impact_cognitive_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Anxiety-Mood Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, anxiety_mood_cluster_score_post_injury_1))
```
### Anxiety-Mood Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(four_impact_test, anxiety_mood_cluster_score_post_injury_1)
```
### Anxiety-Mood Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, anxiety_mood_cluster_score_post_injury_2))
```
### Anxiety-Mood Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(four_impact_test, anxiety_mood_cluster_score_post_injury_2)
```
### Anxiety-Mood Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, anxiety_mood_cluster_score_post_injury_3))
```
### Anxiety-Mood Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(four_impact_test, anxiety_mood_cluster_score_post_injury_3)
```
### Anxiety-Mood Cluster Score Test 4
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, anxiety_mood_cluster_score_post_injury_4))
```
### Anxiety-Mood Cluster Score Test 4 Summary
```{r, include=TRUE}
create_react(four_impact_test, anxiety_mood_cluster_score_post_injury_4)
```
### Boxplot Comparison
```{r, include=FALSE}
four_impact_anxiety_mood_cluster_score <- four_impact_test %>%
select(2, 3, 4, 5, 6, 7, 121, 122, 123, 124) %>%
pivot_longer(
cols = c(7:10),
names_to = "test",
names_prefix = "anxiety_mood_cluster_score_",
values_to = "score"
)
bxp_anova(four_impact_anxiety_mood_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_anova(four_impact_anxiety_mood_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
four_impact_anxiety_mood_cluster_score_outliers <- four_impact_anxiety_mood_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 8, 9, 10)
```
```{r, include=TRUE}
outlier_tbl(four_impact_anxiety_mood_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
four_impact_anxiety_mood_cluster_score_res <- anova_test(four_impact_anxiety_mood_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(four_impact_anxiety_mood_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
four_impact_anxiety_mood_cluster_score_pwc <- four_impact_anxiety_mood_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
four_impact_anxiety_mood_cluster_score_pwc <- four_impact_anxiety_mood_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
four_impact_anxiety_mood_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Ocular-Motor Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, ocular_motor_cluster_score_post_injury_1))
```
### Ocular-Motor Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(four_impact_test, ocular_motor_cluster_score_post_injury_1)
```
### Ocular-Motor Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, ocular_motor_cluster_score_post_injury_2))
```
### Ocular-Motor Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(four_impact_test, ocular_motor_cluster_score_post_injury_2)
```
### Ocular-Motor Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, ocular_motor_cluster_score_post_injury_3))
```
### Ocular-Motor Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(four_impact_test, ocular_motor_cluster_score_post_injury_3)
```
### Ocular-Motor Cluster Score Test 4
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, ocular_motor_cluster_score_post_injury_4))
```
### Ocular-Motor Cluster Score Test 4 Summary
```{r, include=TRUE}
create_react(four_impact_test, ocular_motor_cluster_score_post_injury_4)
```
### Boxplot Comparison
```{r, include=FALSE}
four_impact_ocular_motor_cluster_score <- four_impact_test %>%
select(2, 3, 4, 5, 6, 7, 125, 126, 127, 128) %>%
pivot_longer(
cols = c(7:10),
names_to = "test",
names_prefix = "ocular_motor_cluster_score_",
values_to = "score"
)
bxp_anova(four_impact_ocular_motor_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_anova(four_impact_ocular_motor_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
four_impact_ocular_motor_cluster_score_outliers <- four_impact_ocular_motor_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 8, 9, 10)
```
```{r, include=TRUE}
outlier_tbl(four_impact_ocular_motor_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
four_impact_ocular_motor_cluster_score_res <- anova_test(four_impact_ocular_motor_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(four_impact_ocular_motor_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
four_impact_ocular_motor_cluster_score_pwc <- four_impact_ocular_motor_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
four_impact_ocular_motor_cluster_score_pwc <- four_impact_anxiety_mood_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
four_impact_ocular_motor_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Vestibular Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, vestibular_cluster_score_post_injury_1))
```
### Vestibular Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(four_impact_test, vestibular_cluster_score_post_injury_1)
```
### Vestibular Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, vestibular_cluster_score_post_injury_2))
```
### Vestibular Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(four_impact_test, vestibular_cluster_score_post_injury_2)
```
### Vestibular Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, vestibular_cluster_score_post_injury_3))
```
### Vestibular Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(four_impact_test, vestibular_cluster_score_post_injury_3)
```
### Vestibular Cluster Score Test 4
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, vestibular_cluster_score_post_injury_4))
```
### Vestibular Cluster Score Test 4 Summary
```{r, include=TRUE}
create_react(four_impact_test, vestibular_cluster_score_post_injury_4)
```
### Boxplot Comparison
```{r, include=FALSE}
four_impact_vestibular_cluster_score <- four_impact_test %>%
select(2, 3, 4, 5, 6, 7, 129, 130, 131, 132) %>%
pivot_longer(
cols = c(7:10),
names_to = "test",
names_prefix = "vestibular_cluster_score_",
values_to = "score"
)
bxp_anova(four_impact_vestibular_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_anova(four_impact_vestibular_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
four_impact_vestibular_cluster_score_outliers <- four_impact_vestibular_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 8, 9, 10)
```
```{r, include=TRUE}
outlier_tbl(four_impact_vestibular_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
four_impact_vestibular_cluster_score_res <- anova_test(four_impact_vestibular_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(four_impact_vestibular_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
four_impact_vestibular_cluster_score_pwc <- four_impact_vestibular_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
four_impact_vestibular_cluster_score_pwc <- four_impact_vestibular_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
four_impact_vestibular_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Sleep Cluster Score Test 1
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, sleep_cluster_score_post_injury_1))
```
### Sleep Cluster Score Test 1 Summary
```{r, include=TRUE}
create_react(four_impact_test, sleep_cluster_score_post_injury_1)
```
### Sleep Cluster Score Test 2
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, sleep_cluster_score_post_injury_2))
```
### Sleep Cluster Score Test 2 Summary
```{r, include=TRUE}
create_react(four_impact_test, sleep_cluster_score_post_injury_2)
```
### Sleep Cluster Score Test 3
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, sleep_cluster_score_post_injury_3))
```
### Sleep Cluster Score Test 3 Summary
```{r, include=TRUE}
create_react(four_impact_test, sleep_cluster_score_post_injury_3)
```
### Sleep Cluster Score Test 4
```{r, include=TRUE}
ggplotly(score_hist(four_impact_test, sleep_cluster_score_post_injury_4))
```
### Sleep Cluster Score Test 4 Summary
```{r, include=TRUE}
create_react(four_impact_test, sleep_cluster_score_post_injury_4)
```
### Boxplot Comparison
```{r, include=FALSE}
four_impact_sleep_cluster_score <- four_impact_test %>%
select(2, 3, 4, 5, 6, 7, 133, 134, 135, 136) %>%
pivot_longer(
cols = c(7:10),
names_to = "test",
names_prefix = "sleep_cluster_score_",
values_to = "score"
)
bxp_anova(four_impact_sleep_cluster_score, test, score)
```
```{r, include=TRUE}
ggplotly(bxp_anova(four_impact_sleep_cluster_score, test, score))
```
### Outliers
```{r, include=FALSE}
four_impact_sleep_cluster_score_outliers <- four_impact_sleep_cluster_score %>%
group_by(test) %>%
identify_outliers(score) %>%
select(1, 3, 8, 9, 10)
```
```{r, include=TRUE}
outlier_tbl(four_impact_sleep_cluster_score_outliers)
```
### ANOVA
```{r, include=FALSE}
four_impact_sleep_cluster_score_res <- anova_test(four_impact_sleep_cluster_score,
dv = score,
wid = passport_id,
within = test)
```
```{r, include=TRUE}
get_anova_table(four_impact_sleep_cluster_score_res) %>%
reactable()
```
### Pairwise Comparisons
```{r, include=FALSE}
four_impact_sleep_cluster_score_pwc <- four_impact_sleep_cluster_score %>%
pairwise_t_test(
score ~ test, paired = TRUE,
p.adjust.method = "bonferroni"
)
four_impact_sleep_cluster_score_pwc <- four_impact_sleep_cluster_score_pwc %>%
mutate_at(vars(statistic), list(~ round(., 2)))
```
```{r, include=TRUE}
four_impact_sleep_cluster_score_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Merged Total Symptom Score Summary Test 1
```{r, include=TRUE}
create_react(four_impact_sims, total_symptom_score_post_injury_1)
```
### Merged Total Symptom Score Summary Test 2
```{r, include=TRUE}
create_react(four_impact_sims, total_symptom_score_post_injury_2)
```
### Merged Total Symptom Score Summary Test 3
```{r, include=TRUE}
create_react(four_impact_sims, total_symptom_score_post_injury_3)
```
### Merged Total Symptom Score Summary Test 4
```{r, include=TRUE}
create_react(four_impact_sims, total_symptom_score_post_injury_4)
```
### Merged Headache-Migraine Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(four_impact_sims, headache_migraine_cluster_score_post_injury_1)
```
### Merged Headache-Migraine Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(four_impact_sims, headache_migraine_cluster_score_post_injury_2)
```
### Merged Headache-Migraine Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(four_impact_sims, headache_migraine_cluster_score_post_injury_3)
```
### Merged Headache-Migraine Cluster Score Summary Test 4
```{r, include=TRUE}
create_react(four_impact_sims, headache_migraine_cluster_score_post_injury_4)
```
### Merged Cognitive Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(four_impact_sims, cognitive_cluster_score_post_injury_1)
```
### Merged Cognitive Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(four_impact_sims, cognitive_cluster_score_post_injury_2)
```
### Merged Cognitive Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(four_impact_sims, cognitive_cluster_score_post_injury_3)
```
### Merged Cognitive Cluster Score Summary Test 4
```{r, include=TRUE}
create_react(four_impact_sims, cognitive_cluster_score_post_injury_4)
```
### Merged Anxiety-Mood Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(four_impact_sims, anxiety_mood_cluster_score_post_injury_1)
```
### Merged Anxiety-Mood Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(four_impact_sims, anxiety_mood_cluster_score_post_injury_2)
```
### Merged Anxiety-Mood Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(four_impact_sims, anxiety_mood_cluster_score_post_injury_3)
```
### Merged Anxiety-Mood Cluster Score Summary Test 4
```{r, include=TRUE}
create_react(four_impact_sims, anxiety_mood_cluster_score_post_injury_4)
```
### Merged Ocular-Motor Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(four_impact_sims, ocular_motor_cluster_score_post_injury_1)
```
### Merged Ocular-Motor Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(four_impact_sims, ocular_motor_cluster_score_post_injury_2)
```
### Merged Ocular-Motor Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(four_impact_sims, ocular_motor_cluster_score_post_injury_3)
```
### Merged Ocular-Motor Cluster Score Summary Test 4
```{r, include=TRUE}
create_react(four_impact_sims, ocular_motor_cluster_score_post_injury_4)
```
### Merged Vestibular Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(four_impact_sims, vestibular_cluster_score_post_injury_1)
```
### Merged Vestibular Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(four_impact_sims, vestibular_cluster_score_post_injury_2)
```
### Merged Vestibular Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(four_impact_sims, vestibular_cluster_score_post_injury_3)
```
### Merged Vestibular Cluster Score Summary Test 4
```{r, include=TRUE}
create_react(four_impact_sims, vestibular_cluster_score_post_injury_4)
```
### Merged Sleep Cluster Score Summary Test 1
```{r, include=TRUE}
create_react(four_impact_sims, sleep_cluster_score_post_injury_1)
```
### Merged Sleep Cluster Score Summary Test 2
```{r, include=TRUE}
create_react(four_impact_sims, sleep_cluster_score_post_injury_2)
```
### Merged Sleep Cluster Score Summary Test 3
```{r, include=TRUE}
create_react(four_impact_sims, sleep_cluster_score_post_injury_3)
```
### Merged Sleep Cluster Score Summary Test 4
```{r, include=TRUE}
create_react(four_impact_sims, sleep_cluster_score_post_injury_4)
```
# RTL/RTP
Sidebar {.sidebar}
------------
**_Description:_** This tab provides summaries and visualizations for RTL and RTP duration time structured by the number of post-injury tests completed by the individual. The top row displays how many individuals completed either one, two, three, or four post-injury tests during their recovery and also describes the RTP protocol and requirements to complete the RTL step.
One-way ANOVA's were utilized to evaluate mean differences in RTL duration, RTP duration, and symptom severity at the time of post-injury 1 testing between individuals who completed one post-injury test, two post-injury tests, three post-injury tests, and four post-injury tests. Differences between RTL and RTP duration time were significant. Pairwise comparisons with a Bonferroni correction identified that all comparisons were significant except for the difference in mean duration time to complete RTL and RTP between individuals who completed one post-injury test and two post-injury tests. Individuals who completed three and four post-injury tests were observed to require a significantly longer duration of time to complete both RTL and RTP than individuals who completed one and two post-injury tests.
Differences in mean post-injury 1 symptom severity ratings between individuals, based on the number of post-injury tests completed, were significant or approximating significance for the following symptom clusters: Total Symptom score, Headache-Migraine Cluster, Cognitive Cluster, and the Vestibular Cluster. Pairwise comparisons with a Bonferroni correction identified that all comparisons were significant across all post-injury 1 symptom severity ratings except for the difference in mean symptom severity between individuals who completed one post-injury test and two post-injury tests. Across symptom severity ratings with significant differences at the time of post-injury 1 testing, individuals who completed three and four post-injury tests were observed to report significantly higher symptom severity ratings than individuals who completed one and two post-injury tests.
Row {.tabset}
-----------------------------------------------------------------------
### Data Breakdown
```{r, include=FALSE}
sims_t_sum_pi <- data.frame("Level" = c("One Post-Injury Test",
"Two Post-Injury Tests",
"Three Post-Injury Tests",
"Four Post-Injury Tests"),
"Total" = c(254,
336,
133,
32))
```
```{r, include=FALSE}
sims_pi_plot <- ggplot(sims_t_sum_pi, aes(fct_reorder(Level, Total), Total)) +
geom_col(fill = "blue",
alpha = 0.7) +
coord_flip() +
labs(x = "",
y = "Individuals")
```
```{r, include=TRUE}
ggplotly(sims_pi_plot)
```
### RTP Steps
```{r, include=FALSE}
head(rtp_steps)
rtp_tbl <- rtp_steps %>%
reactable(columns = list(
Step = colDef(name = "Step",
align = "center"),
Description = colDef(name = "Description",
align = "center"),
Definition = colDef(name = "Definition",
align = "center")
),
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE)
```
```{r, include=TRUE}
rtp_tbl
```
### RTL Description
```{r, include=FALSE}
head(rtl)
rtl_tbl <- rtl %>%
reactable(columns = list(
Feature = colDef(name = "Feature",
align = "center"),
Description = colDef(name = "Description",
align = "center")
),
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE)
```
```{r, include=TRUE}
rtl_tbl
```
Row {.tabset}
-----------------------------------------------------------------------
### One Test Onset to Test Summary
```{r, include=TRUE}
create_react_time(one_impact_sims, dys_btwn_onset_test_1)
```
### One Test Onset to Test Plot
```{r, include=FALSE}
onset_hist <- function(df, x) {
ggplot(df, aes({{x}})) +
geom_histogram(fill = "#56B4E9",
color = "white",
alpha = 0.9,
bins = 10) +
facet_wrap(~gender, nrow = 1) +
labs(x = "Days From Injury Onset to Test",
y = "")
}
```
```{r, include=TRUE}
ggplotly(onset_hist(one_impact_sims, dys_btwn_onset_test_1))
```
### One Test RTL Summary
```{r, include=TRUE}
create_react_time(one_impact_sims, dys_btwn_onset_rtp_3)
```
### One Test RTL Plot
```{r, include=FALSE}
rtl_hist <- function(df, x) {
ggplot(df, aes({{x}})) +
geom_histogram(fill = "#56B4E9",
color = "white",
alpha = 0.9,
bins = 10) +
facet_wrap(~gender, nrow = 1) +
labs(x = "Days to Complete RTL",
y = "")
}
rtl_hist(one_impact_sims, dys_btwn_onset_rtp_3)
rtp_hist <- function(df, x) {
ggplot(df, aes({{x}})) +
geom_histogram(fill = "#56B4E9",
color = "white",
alpha = 0.9,
bins = 10) +
facet_wrap(~gender, nrow = 1) +
labs(x = "Days to Complete RTP",
y = "")
}
rtp_hist(one_impact_sims, dys_btwn_onset_rtp_7)
```
```{r, include=TRUE}
ggplotly(rtl_hist(one_impact_sims, dys_btwn_onset_rtp_3))
```
### One Test RTP Summary
```{r, include=TRUE}
create_react_time(one_impact_sims, dys_btwn_onset_rtp_7)
```
### One Test RTP Plot
```{r, include=TRUE}
ggplotly(rtp_hist(one_impact_sims, dys_btwn_onset_rtp_7))
```
Row {.tabset}
-----------------------------------------------------------------------
### Two Tests Onset to Test 2 Summary
```{r, include=TRUE}
create_react_time(two_impact_sims, dys_btwn_onset_test_2)
```
### Two Tests Onset to Test 2 Plot
```{r, include=TRUE}
ggplotly(onset_hist(two_impact_sims, dys_btwn_onset_test_2))
```
### Two Tests RTL Summary
```{r, include=TRUE}
create_react_time(two_impact_sims, dys_btwn_onset_rtp_3)
```
### Two Tests RTL Plot
```{r, include=TRUE}
ggplotly(rtl_hist(two_impact_sims, dys_btwn_onset_rtp_3))
```
### Two Tests RTP Summary
```{r, include=TRUE}
create_react_time(two_impact_sims, dys_btwn_onset_rtp_7)
```
### Two Tests RTP Plot
```{r, include=TRUE}
ggplotly(rtp_hist(two_impact_sims, dys_btwn_onset_rtp_7))
```
Row {.tabset}
-----------------------------------------------------------------------
### Three Tests Onset to Test 3 Summary
```{r, include=TRUE}
create_react_time(three_impact_sims, dys_btwn_onset_test_3)
```
### Three Tests Onset to Test 3 Plot
```{r, include=TRUE}
ggplotly(onset_hist(three_impact_sims, dys_btwn_onset_test_3))
```
### Three Tests RTL Summary
```{r, include=TRUE}
create_react_time(three_impact_sims, dys_btwn_onset_rtp_3)
```
### Three Tests RTL Plot
```{r, include=TRUE}
ggplotly(rtl_hist(three_impact_sims, dys_btwn_onset_rtp_3))
```
### Three Tests RTP Summary
```{r, include=TRUE}
create_react_time(three_impact_sims, dys_btwn_onset_rtp_7)
```
### Three Tests RTP Plot
```{r, include=TRUE}
ggplotly(rtp_hist(three_impact_sims, dys_btwn_onset_rtp_7))
```
Row {.tabset}
-----------------------------------------------------------------------
### Four Tests Onset to Test 4 Summary
```{r, include=TRUE}
create_react_time(four_impact_sims, dys_btwn_onset_test_4)
```
### Four Tests Onset to Test 4 Plot
```{r, include=TRUE}
ggplotly(onset_hist(four_impact_sims, dys_btwn_onset_test_4))
```
### Four Tests RTL Summary
```{r, include=TRUE}
create_react_time(four_impact_sims, dys_btwn_onset_rtp_3)
```
### Four Tests RTL Plot
```{r, include=TRUE}
ggplotly(rtl_hist(four_impact_sims, dys_btwn_onset_rtp_3))
```
### Four Tests RTP Summary
```{r, include=TRUE}
create_react_time(four_impact_sims, dys_btwn_onset_rtp_7)
```
### Four Tests RTP Plot
```{r, include=TRUE}
ggplotly(rtp_hist(four_impact_sims, dys_btwn_onset_rtp_7))
```
Row {.tabset}
-----------------------------------------------------------------------
```{r, include=FALSE}
#binding rows to use for anovas
one_impact_sims_bind <- one_impact_sims %>%
select(3, 6, 24, 25, 52, 53, 54, 55, 56, 57, 58)
two_impact_sims_bind <- two_impact_sims %>%
select(3, 7, 25, 26, 79, 81, 83, 85, 87, 89, 91)
three_impact_sims_bind <- three_impact_sims %>%
select(3, 8, 26, 27, 105, 108, 111, 114, 117, 120, 123)
four_impact_sims_bind <- four_impact_sims %>%
select(3, 9, 27, 28, 131, 135, 139, 143, 147, 151, 155)
all_impact_sims_bind <- bind_rows(one_impact_sims_bind,
two_impact_sims_bind,
three_impact_sims_bind,
four_impact_sims_bind,
.id = "number_tests")
all_impact_sims_bind <- all_impact_sims_bind %>%
mutate(number_tests = as.factor(number_tests))
str(all_impact_sims_bind)
tst_aov <- aov(dys_btwn_onset_rtp_7 ~ number_tests, data = all_impact_sims_bind)
summary(tst_aov)
pairwise.t.test(all_impact_sims_bind$dys_btwn_onset_rtp_7,
all_impact_sims_bind$number_tests,
p.adj = "bonferroni", paired = FALSE)
tst_aov_pwc <- all_impact_sims_bind %>%
pairwise_t_test(
dys_btwn_onset_rtp_7 ~ number_tests, paired = FALSE,
p.adjust.method = "bonferroni"
)
tst_aov_pwc <- tst_aov_pwc %>%
mutate_at(vars(p, p.adj), list(~ round(., 2)))
tst_aov_pwc %>%
reactable()
# anova code above can be used for all outcome variables to compare between test groups
```
### RTL Summary
```{r, include=FALSE}
time_smry_tbl <- function(df, x) {
df %>%
group_by(number_tests) %>%
summarize(mean = mean({{x}}),
sd = sd({{x}}),
min = min({{x}}),
max = max({{x}}),
total = length({{x}})) %>%
mutate(mean = as.numeric(mean),
sd = as.numeric(sd),
min = as.numeric(min),
max = as.numeric(max),
total = as.numeric(total)) %>%
reactable(
columns = list(
number_tests = colDef(name = "Number of Tests Completed",
align = "center"),
mean = colDef(name = "Mean",
align = "center",
format = colFormat(digits = 2, separators = TRUE, suffix = " days")),
sd = colDef(name = "SD",
align = "center",
format = colFormat(digits = 2, separators = TRUE, suffix = " days")),
min = colDef(name = "Min",
align = "center",
format = colFormat(separators = TRUE, suffix = " days")),
max = colDef(name = "Max",
align = "center",
format = colFormat(separators = TRUE, suffix = " days")),
total = colDef(name = "Total",
align = "center",
format = colFormat(separators = TRUE, suffix = " concussions"))),
pagination = TRUE,
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE
)
}
```
```{r, include=TRUE}
time_smry_tbl(all_impact_sims_bind, dys_btwn_onset_rtp_3)
```
### RTL Boxplot Comparison
```{r, include=FALSE}
rtl_bxp <- ggplot(all_impact_sims_bind, aes(number_tests, dys_btwn_onset_rtp_3,
color = dys_btwn_onset_rtp_3)) +
geom_boxplot() +
geom_jitter(position = position_jitter(0.15)) +
labs(x = "Number of Tests Completed",
y = "Number of Days") +
theme(legend.position = "none")
```
```{r, include=TRUE}
ggplotly(rtl_bxp)
```
### RTL ANOVA
```{r, include=FALSE}
rtl_aov <- aov(dys_btwn_onset_rtp_3 ~ number_tests, data = all_impact_sims_bind)
summary(rtl_aov)
rtl_aov
```
```{r, include=TRUE}
summary(rtl_aov)
```
### RTL Pairwise Comparisons
```{r, include=FALSE}
rtl_aov_pwc <- all_impact_sims_bind %>%
pairwise_t_test(
dys_btwn_onset_rtp_3 ~ number_tests, paired = FALSE,
p.adjust.method = "bonferroni"
)
rtl_aov_pwc <- rtl_aov_pwc %>%
mutate_at(vars(p, p.adj), list(~ round(., 2)))
```
```{r, include=TRUE}
rtl_aov_pwc %>%
reactable()
```
### RTP Summary
```{r, include=TRUE}
time_smry_tbl(all_impact_sims_bind, dys_btwn_onset_rtp_7)
```
### RTP Boxplot Comparison
```{r, include=FALSE}
rtp_bxp <- ggplot(all_impact_sims_bind, aes(number_tests, dys_btwn_onset_rtp_7,
color = dys_btwn_onset_rtp_7)) +
geom_boxplot() +
geom_jitter(position = position_jitter(0.15)) +
labs(x = "Number of Tests Completed",
y = "Number of Days") +
theme(legend.position = "none")
```
```{r, include=TRUE}
ggplotly(rtp_bxp)
```
### RTP ANOVA
```{r, include=FALSE}
rtp_aov <- aov(dys_btwn_onset_rtp_7 ~ number_tests, data = all_impact_sims_bind)
summary(rtp_aov)
```
```{r, include=TRUE}
summary(rtp_aov)
```
### RTP Pairwise Comparisons
```{r, include=FALSE}
rtp_aov_pwc <- all_impact_sims_bind %>%
pairwise_t_test(
dys_btwn_onset_rtp_7 ~ number_tests, paired = FALSE,
p.adjust.method = "bonferroni"
)
rtp_aov_pwc <- rtp_aov_pwc %>%
mutate_at(vars(p, p.adj), list(~ round(., 2)))
```
```{r, include=TRUE}
rtp_aov_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Total Symptom Score Test 1 Summary
```{r, include=FALSE}
symptom_smry_tbl <- function(df, x) {
df %>%
group_by(number_tests) %>%
summarize(mean = mean({{x}}),
sd = sd({{x}}),
min = min({{x}}),
max = max({{x}}),
total = length({{x}})) %>%
mutate(mean = as.numeric(mean),
sd = as.numeric(sd),
min = as.numeric(min),
max = as.numeric(max),
total = as.numeric(total)) %>%
reactable(
columns = list(
number_tests = colDef(name = "Number of Tests Completed",
align = "center"),
mean = colDef(name = "Mean",
align = "center",
format = colFormat(digits = 2, separators = TRUE)),
sd = colDef(name = "SD",
align = "center",
format = colFormat(digits = 2, separators = TRUE)),
min = colDef(name = "Min",
align = "center",
format = colFormat(separators = TRUE)),
max = colDef(name = "Max",
align = "center",
format = colFormat(separators = TRUE)),
total = colDef(name = "Total",
align = "center",
format = colFormat(separators = TRUE, suffix = " concussions"))),
pagination = TRUE,
striped = TRUE,
outlined = TRUE,
compact = TRUE,
highlight = TRUE,
bordered = TRUE
)
}
```
### Total Symptom Score Test 1 Summary
```{r, include=TRUE}
symptom_smry_tbl(all_impact_sims_bind, total_symptom_score_post_injury_1)
```
### Total Symptom Score Test 1 Boxplot Comparison
```{r, include=FALSE}
test_1_bxp <- function(df, x, y) {
ggplot(df, aes({{x}}, {{y}}, color = {{y}})) +
geom_boxplot() +
geom_jitter(position = position_jitter(0.15)) +
labs(x = "Number of Tests Completed",
y = "Symptom Severity") +
theme(legend.position = "none")
}
```
```{r, include=TRUE}
ggplotly(test_1_bxp(all_impact_sims_bind, number_tests, total_symptom_score_post_injury_1))
```
### Total Symptom Score Test 1 ANOVA
```{r, include=FALSE}
total_symptom_score_aov <- aov(total_symptom_score_post_injury_1 ~ number_tests, data = all_impact_sims_bind)
```
```{r, include=TRUE}
summary(total_symptom_score_aov)
```
### Total Symptom Score Test 1 Pairwise Comparisons
```{r, include=FALSE}
total_symptom_score_aov_pwc <- all_impact_sims_bind %>%
pairwise_t_test(
total_symptom_score_post_injury_1 ~ number_tests, paired = FALSE,
p.adjust.method = "bonferroni"
)
total_symptom_score_aov_pwc <- rtp_aov_pwc %>%
mutate_at(vars(p, p.adj), list(~ round(., 2)))
```
```{r, include=TRUE}
total_symptom_score_aov_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Headache-Migraine Cluster Score Test 1 Summary
```{r, include=TRUE}
symptom_smry_tbl(all_impact_sims_bind, headache_migraine_cluster_score_post_injury_1)
```
### Headache-Migraine Cluster Score Test 1 Boxplot Comparison
```{r, include=TRUE}
ggplotly(test_1_bxp(all_impact_sims_bind,
number_tests,
headache_migraine_cluster_score_post_injury_1))
```
### Headache-Migraine Cluster Score Test 1 ANOVA
```{r, include=FALSE}
headache_migraine_cluster_score_aov <- aov(headache_migraine_cluster_score_post_injury_1 ~ number_tests, data = all_impact_sims_bind)
```
```{r, include=TRUE}
summary(headache_migraine_cluster_score_aov)
```
### Headache-Migraine Cluster Score Test 1 Pairwise Comparisons
```{r, include=FALSE}
headache_migraine_cluster_score_aov_pwc <- all_impact_sims_bind %>%
pairwise_t_test(
headache_migraine_cluster_score_post_injury_1 ~ number_tests, paired = FALSE,
p.adjust.method = "bonferroni"
)
headache_migraine_cluster_score_aov_pwc <- rtp_aov_pwc %>%
mutate_at(vars(p, p.adj), list(~ round(., 2)))
```
```{r, include=TRUE}
headache_migraine_cluster_score_aov_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Cognitive Cluster Score Test 1 Summary
```{r, include=TRUE}
symptom_smry_tbl(all_impact_sims_bind, cognitive_cluster_score_post_injury_1)
```
### Cognitive Cluster Score Test 1 Boxplot Comparison
```{r, include=TRUE}
ggplotly(test_1_bxp(all_impact_sims_bind,
number_tests,
cognitive_cluster_score_post_injury_1))
```
### Cognitive Cluster Score Test 1 ANOVA
```{r, include=FALSE}
cognitive_cluster_score_aov <- aov(cognitive_cluster_score_post_injury_1 ~ number_tests, data = all_impact_sims_bind)
```
```{r, include=TRUE}
summary(cognitive_cluster_score_aov)
```
### Cognitive Cluster Score Test 1 Pairwise Comparisons
```{r, include=FALSE}
cognitive_cluster_score_aov_pwc <- all_impact_sims_bind %>%
pairwise_t_test(
cognitive_cluster_score_post_injury_1 ~ number_tests, paired = FALSE,
p.adjust.method = "bonferroni"
)
cognitive_cluster_score_aov_pwc <- rtp_aov_pwc %>%
mutate_at(vars(p, p.adj), list(~ round(., 2)))
```
```{r, include=TRUE}
cognitive_cluster_score_aov_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Anxiety-Mood Cluster Score Test 1 Summary
```{r, include=TRUE}
symptom_smry_tbl(all_impact_sims_bind, anxiety_mood_cluster_score_post_injury_1)
```
### Anxiety-Mood Cluster Score Test 1 Boxplot Comparison
```{r, include=TRUE}
ggplotly(test_1_bxp(all_impact_sims_bind,
number_tests,
anxiety_mood_cluster_score_post_injury_1))
```
### Anxiety-Mood Cluster Score Test 1 ANOVA
```{r, include=FALSE}
anxiety_mood_cluster_score_aov <- aov(anxiety_mood_cluster_score_post_injury_1 ~ number_tests, data = all_impact_sims_bind)
```
```{r, include=TRUE}
summary(anxiety_mood_cluster_score_aov)
```
### Anxiety-Mood Cluster Score Test 1 Pairwise Comparisons
```{r, include=FALSE}
anxiety_mood_cluster_score_aov_pwc <- all_impact_sims_bind %>%
pairwise_t_test(
anxiety_mood_cluster_score_post_injury_1 ~ number_tests, paired = FALSE,
p.adjust.method = "bonferroni"
)
anxiety_mood_cluster_score_aov_pwc <- rtp_aov_pwc %>%
mutate_at(vars(p, p.adj), list(~ round(., 2)))
```
```{r, include=TRUE}
anxiety_mood_cluster_score_aov_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Ocular-Motor Cluster Score Test 1 Summary
```{r, include=TRUE}
symptom_smry_tbl(all_impact_sims_bind, ocular_motor_cluster_score_post_injury_1)
```
### Ocular-Motor Cluster Score Test 1 Boxplot Comparison
```{r, include=TRUE}
ggplotly(test_1_bxp(all_impact_sims_bind,
number_tests,
ocular_motor_cluster_score_post_injury_1))
```
### Ocular-Motor Cluster Score Test 1 ANOVA
```{r, include=FALSE}
ocular_motor_cluster_score_aov <- aov(ocular_motor_cluster_score_post_injury_1 ~ number_tests, data = all_impact_sims_bind)
```
```{r, include=TRUE}
summary(ocular_motor_cluster_score_aov)
```
### Ocular-Motor Cluster Score Test 1 Pairwise Comparisons
```{r, include=FALSE}
ocular_motor_cluster_score_aov_pwc <- all_impact_sims_bind %>%
pairwise_t_test(
ocular_motor_cluster_score_post_injury_1 ~ number_tests, paired = FALSE,
p.adjust.method = "bonferroni"
)
ocular_motor_cluster_score_aov_pwc <- rtp_aov_pwc %>%
mutate_at(vars(p, p.adj), list(~ round(., 2)))
```
```{r, include=TRUE}
ocular_motor_cluster_score_aov_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Vestibular Cluster Score Test 1 Summary
```{r, include=TRUE}
symptom_smry_tbl(all_impact_sims_bind, vestibular_cluster_score_post_injury_1)
```
### Vestibular Cluster Score Test 1 Boxplot Comparison
```{r, include=TRUE}
ggplotly(test_1_bxp(all_impact_sims_bind,
number_tests,
vestibular_cluster_score_post_injury_1))
```
### Vestibular Cluster Score Test 1 ANOVA
```{r, include=FALSE}
vestibular_cluster_score_aov <- aov(vestibular_cluster_score_post_injury_1 ~ number_tests, data = all_impact_sims_bind)
```
```{r, include=TRUE}
summary(vestibular_cluster_score_aov)
```
### Vestibular Cluster Score Test 1 Pairwise Comparisons
```{r, include=FALSE}
vestibular_cluster_score_aov_pwc <- all_impact_sims_bind %>%
pairwise_t_test(
vestibular_cluster_score_post_injury_1 ~ number_tests, paired = FALSE,
p.adjust.method = "bonferroni"
)
vestibular_cluster_score_aov_pwc <- rtp_aov_pwc %>%
mutate_at(vars(p, p.adj), list(~ round(., 2)))
```
```{r, include=TRUE}
vestibular_cluster_score_aov_pwc %>%
reactable()
```
Row {.tabset}
-----------------------------------------------------------------------
### Sleep Cluster Score Test 1 Summary
```{r, include=TRUE}
symptom_smry_tbl(all_impact_sims_bind, sleep_cluster_score_post_injury_1)
```
### Sleep Cluster Score Test 1 Boxplot Comparison
```{r, include=TRUE}
ggplotly(test_1_bxp(all_impact_sims_bind,
number_tests,
sleep_cluster_score_post_injury_1))
```
### Sleep Cluster Score Test 1 ANOVA
```{r, include=FALSE}
sleep_cluster_score_aov <- aov(sleep_cluster_score_post_injury_1 ~ number_tests, data = all_impact_sims_bind)
```
```{r, include=TRUE}
summary(sleep_cluster_score_aov)
```
### Sleep Cluster Score Test 1 Pairwise Comparisons
```{r, include=FALSE}
sleep_cluster_score_aov_pwc <- all_impact_sims_bind %>%
pairwise_t_test(
sleep_cluster_score_post_injury_1 ~ number_tests, paired = FALSE,
p.adjust.method = "bonferroni"
)
sleep_cluster_score_aov_pwc <- rtp_aov_pwc %>%
mutate_at(vars(p, p.adj), list(~ round(., 2)))
```
```{r, include=TRUE}
sleep_cluster_score_aov_pwc %>%
reactable()
```